package dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Conexao {
	
	Connection conexao;
	
	public Conexao() throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
		DriverManager.registerDriver(new org.postgresql.Driver());
		this.conexao = DriverManager.getConnection("jdbc:postgresql://localhost:5432/pizzaria", "postgres", "postgres");
	}

	public Connection getConexao() {
		
		return conexao;
	}
	
	public void fecharConexao() throws SQLException {
		this.conexao.close();
	}

}